package com.xbell.app.sys.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value="homec")
public class HomeCController {
	/*
	@Autowired
	RedissonClient rc;
	
	@PostMapping(value="save")
	public Object saveFile(String title,String content) throws UnsupportedEncodingException, IOException {
		System.out.println(title);
		Duration d =  Duration.ofDays(20);
		RMap<String,Integer> rp = this.rc.getMap("mp");
		if(rp.get(title)!=null)return "exists";
		rp.put(title, 1);
		rp.expire(d);
		JSONObject obj = new JSONObject();
		obj.put("title", title);
		obj.put("content", content);
		RList<JSONObject> rl = rc.getList("list");
		rl.add(obj);
		rl.expire(d);
		try(FileOutputStream fs = new FileOutputStream("/Users/lisummer/UserData/workspace/java/apptwo/file/"+title+".txt")){
			fs.write(content.getBytes("utf-8"));
			fs.flush();
		}
		return null;
	}
	*/
}
